<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FFmpegKit Linux API: fftools_thread_queue.h File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="../../ffmpeg-kit-icon-v9-small.png"/></td>
  <td id="projectalign">
   <div id="projectname">FFmpegKit Linux API<span id="projectnumber">&#160;6.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">fftools_thread_queue.h File Reference</div></div>
</div><!--header-->
<div class="contents">

<p><a href="../../da/d87/fftools__thread__queue_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:acce42a109ac181505c1bd02a7bc3400d"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d87/fftools__thread__queue_8h.html#acce42a109ac181505c1bd02a7bc3400d">ThreadQueue</a></td></tr>
<tr class="separator:acce42a109ac181505c1bd02a7bc3400d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a7c344c91be2c77f54a4b23a7fbe03497"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d87/fftools__thread__queue_8h.html#a7c344c91be2c77f54a4b23a7fbe03497">tq_alloc</a> (unsigned <a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a> <a class="el" href="../../d8/d78/fftools__ffprobe_8c.html#abad15c2aaf9c54ccddd8d8abf6bed069">nb_streams</a>, size_t queue_size, <a class="el" href="../../d4/d62/struct_obj_pool.html">ObjPool</a> *obj_pool, void(*obj_move)(void *dst, void *src))</td></tr>
<tr class="separator:a7c344c91be2c77f54a4b23a7fbe03497"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af889d9deaee0903feeb0b3168df06e92"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d87/fftools__thread__queue_8h.html#af889d9deaee0903feeb0b3168df06e92">tq_free</a> (<a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> **tq)</td></tr>
<tr class="separator:af889d9deaee0903feeb0b3168df06e92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bec668d052dc9e28960f5a48d178aa0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d87/fftools__thread__queue_8h.html#a3bec668d052dc9e28960f5a48d178aa0">tq_send</a> (<a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> *tq, unsigned <a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a> stream_idx, void *data)</td></tr>
<tr class="separator:a3bec668d052dc9e28960f5a48d178aa0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22d0fb73f10c4603e84096e73353a866"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d87/fftools__thread__queue_8h.html#a22d0fb73f10c4603e84096e73353a866">tq_send_finish</a> (<a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> *tq, unsigned <a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a> stream_idx)</td></tr>
<tr class="separator:a22d0fb73f10c4603e84096e73353a866"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd4f6ad1dabc31688aa7822c206460d6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d87/fftools__thread__queue_8h.html#acd4f6ad1dabc31688aa7822c206460d6">tq_receive</a> (<a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> *tq, <a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a> *stream_idx, void *data)</td></tr>
<tr class="separator:acd4f6ad1dabc31688aa7822c206460d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe3a128598718b5837d6127f3e88cdbd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d87/fftools__thread__queue_8h.html#afe3a128598718b5837d6127f3e88cdbd">tq_receive_finish</a> (<a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> *tq, unsigned <a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a> stream_idx)</td></tr>
<tr class="separator:afe3a128598718b5837d6127f3e88cdbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="acce42a109ac181505c1bd02a7bc3400d" name="acce42a109ac181505c1bd02a7bc3400d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acce42a109ac181505c1bd02a7bc3400d">&#9670;&#160;</a></span>ThreadQueue</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> <a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="../../da/d87/fftools__thread__queue_8h_source.html#l00039">39</a> of file <a class="el" href="../../da/d87/fftools__thread__queue_8h_source.html">fftools_thread_queue.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a7c344c91be2c77f54a4b23a7fbe03497" name="a7c344c91be2c77f54a4b23a7fbe03497"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7c344c91be2c77f54a4b23a7fbe03497">&#9670;&#160;</a></span>tq_alloc()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> * tq_alloc </td>
          <td>(</td>
          <td class="paramtype">unsigned <a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a>&#160;</td>
          <td class="paramname"><em>nb_streams</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>queue_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d4/d62/struct_obj_pool.html">ObjPool</a> *&#160;</td>
          <td class="paramname"><em>obj_pool</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*)(void *dst, void *src)&#160;</td>
          <td class="paramname"><em>obj_move</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Allocate a queue for sending data between threads.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">nb_streams</td><td>number of streams for which a distinct EOF state is maintained </td></tr>
    <tr><td class="paramname">queue_size</td><td>number of items that can be stored in the queue without blocking </td></tr>
    <tr><td class="paramname">obj_pool</td><td>object pool that will be used to allocate items stored in the queue; the pool becomes owned by the queue </td></tr>
    <tr><td class="paramname">callback</td><td>that moves the contents between two data pointers </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="../../dc/d56/fftools__thread__queue_8c_source.html#l00093">93</a> of file <a class="el" href="../../dc/d56/fftools__thread__queue_8c_source.html">fftools_thread_queue.c</a>.</p>

</div>
</div>
<a id="af889d9deaee0903feeb0b3168df06e92" name="af889d9deaee0903feeb0b3168df06e92"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af889d9deaee0903feeb0b3168df06e92">&#9670;&#160;</a></span>tq_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tq_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> **&#160;</td>
          <td class="paramname"><em>tq</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="../../dc/d56/fftools__thread__queue_8c_source.html#l00069">69</a> of file <a class="el" href="../../dc/d56/fftools__thread__queue_8c_source.html">fftools_thread_queue.c</a>.</p>

</div>
</div>
<a id="acd4f6ad1dabc31688aa7822c206460d6" name="acd4f6ad1dabc31688aa7822c206460d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acd4f6ad1dabc31688aa7822c206460d6">&#9670;&#160;</a></span>tq_receive()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a> tq_receive </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> *&#160;</td>
          <td class="paramname"><em>tq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a> *&#160;</td>
          <td class="paramname"><em>stream_idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Read the next item from the queue.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">stream_idx</td><td>the index of the stream that was processed or -1 will be written here </td></tr>
    <tr><td class="paramname">data</td><td>the data item will be written here on success using the callback provided to <a class="el" href="../../da/d87/fftools__thread__queue_8h.html#a7c344c91be2c77f54a4b23a7fbe03497">tq_alloc()</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>0 a data item was successfully read; *stream_idx contains a non-negative stream index</li>
<li>AVERROR_EOF When *stream_idx is non-negative, this signals that the sending side has marked the given stream as finished. This will happen at most once for each stream. When *stream_idx is -1, all streams are done. </li>
</ul>
</dd></dl>

<p class="definition">Definition at line <a class="el" href="../../dc/d56/fftools__thread__queue_8c_source.html#l00205">205</a> of file <a class="el" href="../../dc/d56/fftools__thread__queue_8c_source.html">fftools_thread_queue.c</a>.</p>

</div>
</div>
<a id="afe3a128598718b5837d6127f3e88cdbd" name="afe3a128598718b5837d6127f3e88cdbd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afe3a128598718b5837d6127f3e88cdbd">&#9670;&#160;</a></span>tq_receive_finish()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tq_receive_finish </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> *&#160;</td>
          <td class="paramname"><em>tq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned <a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a>&#160;</td>
          <td class="paramname"><em>stream_idx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Mark the given stream finished from the receiving side. </p>

<p class="definition">Definition at line <a class="el" href="../../dc/d56/fftools__thread__queue_8c_source.html#l00246">246</a> of file <a class="el" href="../../dc/d56/fftools__thread__queue_8c_source.html">fftools_thread_queue.c</a>.</p>

</div>
</div>
<a id="a3bec668d052dc9e28960f5a48d178aa0" name="a3bec668d052dc9e28960f5a48d178aa0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3bec668d052dc9e28960f5a48d178aa0">&#9670;&#160;</a></span>tq_send()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a> tq_send </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> *&#160;</td>
          <td class="paramname"><em>tq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned <a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a>&#160;</td>
          <td class="paramname"><em>stream_idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Send an item for the given stream to the queue.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>the item to send, its contents will be moved using the callback provided to <a class="el" href="../../da/d87/fftools__thread__queue_8h.html#a7c344c91be2c77f54a4b23a7fbe03497">tq_alloc()</a>; on failure the item will be left untouched </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>0 the item was successfully sent</li>
<li>AVERROR(ENOMEM) could not allocate an item for writing to the FIFO</li>
<li>AVERROR(EINVAL) the sending side has previously been marked as finished</li>
<li>AVERROR_EOF the receiving side has marked the given stream as finished </li>
</ul>
</dd></dl>

<p class="definition">Definition at line <a class="el" href="../../dc/d56/fftools__thread__queue_8c_source.html#l00134">134</a> of file <a class="el" href="../../dc/d56/fftools__thread__queue_8c_source.html">fftools_thread_queue.c</a>.</p>

</div>
</div>
<a id="a22d0fb73f10c4603e84096e73353a866" name="a22d0fb73f10c4603e84096e73353a866"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a22d0fb73f10c4603e84096e73353a866">&#9670;&#160;</a></span>tq_send_finish()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tq_send_finish </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d9/db4/struct_thread_queue.html">ThreadQueue</a> *&#160;</td>
          <td class="paramname"><em>tq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned <a class="el" href="../../d2/d36/fftools__ffmpeg__filter_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a>&#160;</td>
          <td class="paramname"><em>stream_idx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Mark the given stream finished from the sending side. </p>

<p class="definition">Definition at line <a class="el" href="../../dc/d56/fftools__thread__queue_8c_source.html#l00231">231</a> of file <a class="el" href="../../dc/d56/fftools__thread__queue_8c_source.html">fftools_thread_queue.c</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 22 2023 01:27:12 for FFmpegKit Linux API by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7
</small></address>
</body>
</html>
